function RxFindMultiColor(color, posandcolors, X1, Y1, X2, Y2, tab) --区域找色找色判断函数
  local rtn = 0
  local x, y = -1
  keepScreen(true)
  for deg = 92, 88, -1 do --使用 for 循环不断降低精确度
    if posandcolors ~= "" then
      x, y = findMultiColorInRegionFuzzy(color, posandcolors, deg, X1, Y1, X2, Y2, tab) -- 区域多点找色
    else
      x, y = findColorInRegionFuzzy(color, deg, X1, Y1, X2, Y2) -- 区域单点找色
    end
    if x ~= -1 and y ~= -1 then --如果在指定区域找到某点符合条件
      rtn = 1
      keepScreen(false)
      break --并跳出循环
    end
  end
  keepScreen(false)
  mSleep(1)
  return rtn, x, y
end

-- 使用颜色库 ColorLib
function RxFindMultiColorTable(table)
  local x1, y1, x2, y2 = RxLocationTableScale(table)
  local rtn, x, y = RxFindMultiColor(table.color, table.posandcolors, x1, y1, x2, y2, table.tab)
  if table and table.title then
    RxLog('FindColor '..tostring(table.title)..'___'..tostring(table)..'--rtn='..tostring(rtn)..'--x='..tostring(x)..'--y='..tostring(y))
  end
  return rtn, x, y
end

-- 使用颜色库 ColorScreenLib - 需要代码给 sizeTable(按照 colorLib形式给)
function RxFindMultiColorScreenTable(table, sizeTable)
  local x1, y1, x2, y2 = RxLocationTableScale(sizeTable)
  local rtn, x, y = RxFindMultiColor(table.color, table.posandcolors, x1, y1, x2, y2, table.tab)
  if table and table.title then
    RxLog('FindColor '..tostring(table.title)..'___'..tostring(table)..'--rtn='..tostring(rtn)..'--x='..tostring(x)..'--y='..tostring(y))
  end
  return rtn, x, y
end

-- 避免使用这个，循环查找一个色，使用颜色库 ColorLib
function RxFindColor(ctable)
  local rtn = 0
  ctable.posandcolors = ""
  ctable.tab = ""
  keepScreen(true)
  local x, y = -1,-1
  for deg = 100, 90, -1 do --使用 for 循环不断降低精确度
    x, y = RxFindMultiColorTable(ctable) -- 区域单点找色
    if x ~= -1 and y ~= -1 then --如果在指定区域找到某点符合条件
      rtn = 1
      keepScreen(false)
      break --并跳出循环
    end
  end
  keepScreen(false)
  return rtn, x, y
end

function RxFindMultiColorOfArrayTable(tables)
  local rtn, x, y = RxTouchWithColorOfArrayTable(tables, false)
  return rtn, x, y
end

function RxTouchWithColorOfArrayTable(tables, isTouch)
  if isTouch == nil then isTouch = true end
  local ctn,x,y = 0,-1,-1

  if not tables then return ctn,x,y end
  local len = RxTable:len(tables)
  if len < 1 then return ctn,x,y end

  local n = 0
  while true do
    n = n + 1
    if n > len then break end
    local table = tables[n]
    local x1, y1, x2, y2 = RxLocationTableScale(table)
    ctn, x, y = RxFindMultiColor(table.color, table.posandcolors, x1, y1, x2, y2, table.tab)
    if table and table.title then
      RxLog('FindColor '..tostring(table.title)..'___'..tostring(table)..'--rtn='..tostring(ctn)..'--x='..tostring(x)..'--y='..tostring(y))
    end

    if ctn == 1 then
      if isTouch then
        if table.point then
          RxTouchPointTable(table)
        else
          RxTouch(x, y)
        end
      end
      break
    end
  end

  return ctn, x, y
end